const { Schema, model } = require("mongoose")
const bcrypt = require("bcrypt")

const AdminUserSchema = new Schema({
    username: { type: String },
    password: {
        type: String,
        select: false,
        set(val) {
            return bcrypt.hashSync(val, 12)
        }
    },
})

module.exports = model("AdminUser", AdminUserSchema)